// 导入请求实例
import request from "@/utils/request";
// // 导入仓库实例
// import store from "@/store";

// 获取用户资料请求
export const getUserProfile = () => {
  return request({
    url: "/v1_0/user",
    // headers: {
    //   Authorization: `Bearer ${store.getters.token}`,
    // },
  });
};

/**
 * 获取当前登录用户的个人资料
 */
export const getUserInfo = () => {
  return request({
    method: "GET",
    url: "/v1_0/user/profile",
  });
};
// 更新用户资料
export const updateUserInfo = (data) => {
  return request({
    method: "PATCH",
    url: "/v1_0/user/profile",
    data,
  });
};

// 更新用户头像
export const updateUserPhoto = (data) => {
  return request({
    method: "PATCH",
    url: "/v1_0/user/photo",
    data,
  });
};
